/**
 * BatchRunningMode.java - 2012-3-27
 *
 * Licensed Property to China UnionPay Co., Ltd.
 * 
 * (C) Copyright of China UnionPay Co., Ltd. 2010
 *     All Rights Reserved.
 *
 * Project Info: China UnionPay Internet Acquiring Project
 * 
 * Modification History:
 * =============================================================================
 *   Author         Date          Description
 *   ------------ ---------- ---------------------------------------------------
 *        
 * =============================================================================
 */
package com.lijin.batchsys.framework.enums;


/**
 * Description: 发生异常的批次执行模式
 *
 * (C) Copyright of China UnionPay Co., Ltd. 2010.
 *
 */
public enum ErrBatchHandleMode {

	RESTART_BATCH("0", "重新执行整个批次"),
	IGNORE_STEP_GO_ON("1", "忽略该步骤-并继续执行"),
	RESTART_STEP_GO_ON("2", "重新执行该步骤-并继续执行"),
	RESTART_SINGLE_STEP("3", "只重新执行该步骤"),
	RESTART_SINGLE_JOB("4", "只重新执行所属的任务"),
	RESTART_STEP_JOB_GO_ON("5", "重新执行该步骤-并继续执行该任务"),
	IGNORE_STEP_JOB_GO_ON("6", "忽略该步骤-并继续执行该任务");
	
	private String code;
	private String desc;
	
	private ErrBatchHandleMode(String code, String desc) {
		this.code = code;
		this.desc = desc;
	}

	public String getCode() {
		return code;
	}

	public void setCode(String code) {
		this.code = code;
	}

	public String getDesc() {
		return desc;
	}

	public void setDesc(String desc) {
		this.desc = desc;
	}
	
	public static ErrBatchHandleMode parseByCode(String code) {
		for (ErrBatchHandleMode mode : ErrBatchHandleMode.values()) {
			if (mode.getCode().equals(code)) {
				return mode;
			}
		}
		return null;
	}
}
